home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fatted Calf
/
The Fatted Calf.iso
/
Modules
/
BackSpaceModules
/
Source
/
IconMosaicView
/
DefaultsTable.h
< prev
next >
Wrap
Text File
|
1993-01-25
|
2KB
|
65 lines
/* File: DefaultsTable.h - NXString subclass for handling defaults
*
* By: Christopher Lane
* Symbolic Systems Resources Group
* Knowledge Systems Laboratory
* Stanford University
*
* Date: 25 January 1993
*
* Copyright: 1992 & 1993 by The Leland Stanford Junior University.
* portions copyright 1992, 1993 by Christopher Lane
* This program may be distributed without restriction for non-commercial use.
*/
#import <objc/NXStringTable.h>
#import <defaults/defaults.h>
#import <appkit/Application.h>
#import <appkit/color.h>
#define SYSTEM "System"
#define getDefault(s) NXGetDefaultValue([NXApp appName], s)
#define getIntDefault(s) atoi(getDefault(s))
#define getBoolDefault(s) ((strncasecmp(getDefault(s), "Yes", 1) == 0) ? YES : NO)
#define writeBoolDefault(s, v) writeDefault(s, (v) ? "Yes" : "No")
#define getStringDefault(s) getDefault(s)
#define getFloatDefault(s) atof(getDefault(s))
#define getSystemDefault(s) NXGetDefaultValue(SYSTEM, s)
#define writeDefault(s, v) NXWriteDefault([NXApp appName], s, v)
#define writeStringDefault(s, v) NXWriteDefault([NXApp appName], s, v)
int writeIntDefault(const char *name, int value);
int writeFloatDefault(const char *name, float value);
int writeSizeDefault(const char *name, NXSize size);
NXSize getSizeDefault(const char *name);
int writePointDefault(const char *name, NXPoint point);
NXPoint getPointDefault(const char *name);
int writeColorDefault(const char *name, NXColor color);
NXColor getColorDefault(const char *name);
@interface DefaultsTable : NXStringTable
- initFromFile:(const char *) file;
- registerDefaults:(const char *) owner;
- writeDefaults:(const char *) owner;
- updateDefaults;
- (int) applyToDefaults:(const char *) owner function:(int (*)(const char *, const NXDefaultsVector)) routine;
@end